﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;

//源码由51aspx 发布
namespace WebSite_CodeMan.Sys_CodeMan_Manage
{
    public partial class Admin_Update_Leave : System.Web.UI.Page
    {
        protected string strLeaveNote = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        private void LoadData()
        {
            string strLID = Common.GetMes.GetRequestQuery(Request, "LID");
            if (!string.IsNullOrEmpty(strLID))
            {
                OleDbDataReader DataRead = BLL.LeaveInfo.GetAllLeaveInfo(strLID);
                if (DataRead.HasRows)
                {
                    DataRead.Read();
                    strLeaveNote = DataRead["T_LeaveNote"].ToString();
                    txtLeaveNote.Value = DataRead["T_LeaveReBack"].ToString();
                }
                DataRead.Close();
                DataRead.Dispose();
            }
        }

        protected void BtnLeaveSave_Click(object sender, EventArgs e)
        {
            string strLID = Common.GetMes.GetRequestQuery(Request, "LID");
            if (BLL.LeaveInfo.BackLeaveMes(strLID, Server.HtmlEncode(txtLeaveNote.Value.Trim())))
            {
                Common.MessageBox.Show(Page, "留言回复成功，返回留言列表...", "Admin_Leave_Mes.aspx", "suess");
            }
            else
            {
                Common.MessageBox.Show(Page, "留言回复失败，请重试或联系技术人员...", "error");
            }
        }
    }
}
